﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
	CodeBehind="Default.aspx.cs" Inherits="TraceThisItem.WebUI.Workflows.Default" %>

<asp:Content ID="Head" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Body" ContentPlaceHolderID="MainContent" runat="server">
	<h1>
		Workflows del sistema
	</h1>
	<asp:Label ID="MessageText" runat="server" CssClass="failureNotification" />
	<p>
		<asp:HyperLink NavigateUrl="~/Workflows/Create.aspx" runat="server" Text="Crear nuevo" />
	</p>
	<asp:GridView ID="WorkflowGridView" runat="server" AutoGenerateColumns="False" DataSourceID="WorkflowDataSource"
		Width="100%" DataKeyNames="Id" onrowcommand="WorkflowGridView_RowCommand">
		<Columns>
			<asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id">
				<HeaderStyle Width="10%"></HeaderStyle>
			</asp:BoundField>
			<asp:BoundField DataField="Name" HeaderText="Nombre" SortExpression="Name" />
			<asp:TemplateField ShowHeader="False">
				<ItemTemplate>
					<asp:LinkButton Text="Editar" runat="server" CommandName="Edit" CommandArgument='<%# Eval("Id") %>' />
					<asp:LinkButton ID="DeleteLinkButton" runat="server" CausesValidation="False" CommandName="Delete"
						Text="Eliminar" OnClientClick="return confirm('¿Está seguro que desea eliminar el workflow?')" />
				</ItemTemplate>
			</asp:TemplateField>
		</Columns>
	</asp:GridView>
	<asp:ObjectDataSource ID="WorkflowDataSource" runat="server" OldValuesParameterFormatString="original_{0}"
		SelectMethod="GetWorkFlows" TypeName="TraceThisItem.Domain.Facade" DataObjectTypeName="TraceThisItem.Domain.Workflow"
		OnObjectCreating="WorkflowDataSource_ObjectCreating" 
		ondeleting="WorkflowDataSource_Deleting" DeleteMethod="RemoveWorkflow" />
</asp:Content>
